package tec.stan.ling.topo.model;

import org.xmappr.Attribute;

import tec.stan.ling.core.notifier.Notification;
import tec.stan.ling.core.notifier.impl.NotificationImpl;
import tec.stan.ling.core.notifier.impl.NotifierImpl;
import tec.stan.ling.core.top.model.NE;
import tec.stan.ling.core.top.model.NEType;

public abstract class NEImpl extends NotifierImpl implements NE {

	@Attribute
	protected int id;

	protected NEType type;

	@Attribute
	private String name;

	@Override
	public int getId() {
		return id;
	}

	@Deprecated
	public void setId(int id){
		this.id = id;
	}	
	
	@Override
	public NEType getType() {
		return type;
	}

	@Override
	public void setName(String name) {
		String oldName = this.name;
		this.name = name;
		if (isDeliver()) {
			notify(new NotificationImpl(this, Notification.SET, NE.NE_NAME,
					oldName, name));
		}
	}

	@Override
	public String getName() {
		return name;
	}
}
